package com.pojo;


import lombok.Data;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import java.util.Date;

@Data
public class User {
    private Long id;

    @NotEmpty(message = "用户名不能为空")
    @Pattern(regexp = "^\\S{3,20}$", message = "用户名长度3-20位，不能有空格")
    private String username;

    @NotEmpty(message = "密码不能为空")
    @Pattern(regexp = "^\\S{6,20}$", message = "密码长度6-20位，不能有空格")
    private String password;

    @Email(message = "邮箱格式不正确")
    private String email;

    private String role;  // user / admin

    private Integer status;

    private Date createTime;
}